package com.engine.salary.service;

import com.engine.salary.entity.salaryacct.param.SalaryAcctResultQueryParam;
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
import com.engine.salary.entity.salarysob.dto.SalaryApprovalDTO;
import com.engine.salary.entity.salarysob.param.ApprovalRequestSaveParam;
import com.engine.salary.entity.salarysob.param.SalaryApprovalQueryParam;
import com.engine.salary.entity.salarysob.po.SalaryApprovalRulePO;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * @author Harryxzy
 * @ClassName SalaryApprovalRuleService
 * @date 2024/04/23 17:33
 * @description 薪资核算审批规则
 */
public interface SalaryApprovalRuleService {

    /**
     * 查询所有记录
     *
     * @return 返回集合，没有返回空List
     */
    List<SalaryApprovalRulePO> listAll();


    /**
     * 根据主键查询
     *
     * @param id 主键
     * @return 返回记录，没有返回null
     */
    SalaryApprovalRulePO getById(Long id);


    /**
     * 新增，忽略null字段
     *
     * @param salaryApprovalRule 新增的记录
     * @return 返回影响行数
     */
    int insertIgnoreNull(SalaryApprovalRulePO salaryApprovalRule);

    /**
     * 修改，修改所有字段
     *
     * @param salaryApprovalRule 修改的记录
     * @return 返回影响行数
     */
    int update(SalaryApprovalRulePO salaryApprovalRule);

    /**
     * 修改，忽略null字段
     *
     * @param salaryApprovalRule 修改的记录
     * @return 返回影响行数
     */
    int updateIgnoreNull(SalaryApprovalRulePO salaryApprovalRule);

    /**
     * 删除记录
     *
     * @param salaryApprovalRule 待删除的记录
     * @return 返回影响行数
     */
    int delete(SalaryApprovalRulePO salaryApprovalRule);

    /**
     * 根据账套id查询审批设置
     * @param salarySobId
     * @return
     */
    SalaryApprovalRulePO getBySalarySobId(Long salarySobId);

    /**
     * 根据薪资账套id删除
     * @param salarySobId
     */
    void deleteBySalarySobId(Long salarySobId);

    /**
     * 薪资账套的薪资审批规则
     * @param queryParam
     * @return
     */
    SalaryApprovalDTO salaryApprovalForm(SalaryApprovalQueryParam queryParam);

    /**
     * 保存薪资账套的薪资审批规则
     * @param salaryApprovalDTO
     */
    void saveSalaryApprovalForm(SalaryApprovalDTO salaryApprovalDTO);

    List<SalaryItemPO> listSalaryApprovalItem(SalaryItemSearchParam queryParam);

    SalaryApprovalDTO getApprovalInfoByRecordId(Long salaryAcctRecordId);

    /**
     * 获取该核算记录是否可以编辑、核算
     * @param salaryAcctRecordPO
     * @return
     */
    boolean getRecordIsCanEdit(SalaryAcctRecordPO salaryAcctRecordPO);

    /**
     * 保存审批流程id
     * @param saveParam
     */
    void saveApprovalRequestId(ApprovalRequestSaveParam saveParam);

    void deleteBySalarySobIds(Collection<Long> ids);

    List<SalaryApprovalRulePO> listBySalarySobIds(Collection<Long> salarySobIds);


    Map<String, Object> sumRow(SalaryAcctResultQueryParam queryParam);
}
